/**
 * Copyright By Nanjing Fujitsu Nanda Software Technology Co., Ltd
 * 下午6:03:10
 * EventMethod.java
 * 
 */
package com.fujitsu.nanjing.mobile.model;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

import java.util.Hashtable;

/**
 * @author qixb.fnst
 * 
 */
public class EventMethod implements KvmSerializable {

    private int eventType;

    private String eventName;

    private String eventContent;

    public int getEventType() {
        return eventType;
    }

    public void setEventType(int eventType) {
        this.eventType = eventType;
    }

    @Override
    public String toString() {
        return "EventMethod [eventType=" + eventType + ", eventName="
                + eventName + ", eventContent=" + eventContent + "]";
    }

    public String getEventName() {
        return eventName;
    }

    public void setEventName(String eventName) {
        this.eventName = eventName;
    }

    public String getEventContent() {
        return eventContent;
    }

    public void setEventContent(String eventContent) {
        this.eventContent = eventContent;
    }

    @Override
    public Object getProperty(int arg0) {
        switch (arg0) {
        case 0:
            return this.eventType;
        case 1:
            return this.eventName;
        case 2:
            return this.eventContent;

        default:
            break;
        }
        return null;
    }

    @Override
    public int getPropertyCount() {
        return 3;
    }

    @SuppressWarnings("rawtypes")
    @Override
    public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
        switch (arg0) {
        case 0:
            arg2.name = "eventType";
            arg2.type = PropertyInfo.INTEGER_CLASS;
            break;
        case 1:
            arg2.name = "eventName";
            arg2.type = PropertyInfo.STRING_CLASS;
            break;
        case 2:
            arg2.name = "eventContent";
            arg2.type = PropertyInfo.STRING_CLASS;
            break;

        default:
            break;
        }

    }

    @Override
    public void setProperty(int arg0, Object arg1) {
        switch (arg0) {
        case 0:
            this.eventType = Integer.parseInt(arg1.toString());
            break;
        case 1:
            this.eventName = arg1.toString();
            break;
        case 2:
            this.eventContent = arg1.toString();
            break;

        default:
            break;
        }
    }

}
